package com.smileymedia.smil.stage;

import java.util.ArrayList;
import java.util.List;

/**
 * Executes events in Sequence
 * @author greg
 *
 */
public class SequenceTimeline extends Timeline {
	private List<Timeline> mTimelines;
	
	public SequenceTimeline() {
		mTimelines=new ArrayList<Timeline>();
	}

	public void add(Timeline timeline) {
		mTimelines.add(timeline);
	}

	public List<Timeline>  getTimelines() {
		return mTimelines;
	}
	
	@Override
	public double getTotalPlayTime() {
		double total=0d;
		int size=mTimelines.size();
		for(int i=0;i<size;i++){
			total+=mTimelines.get(i).getTotalPlayTime();
		}
		return total;
	}

}
